<?php
	class S2scam extends Model_Abstract{
		
		public function add($campaignID, $affiliateID, $subIDs){
			$params = array('campaignID' => $campaignID,
						'affiliateID' => $affiliateID,
						'subIDs' => $subIDs,
			);
			$url = "https://www.drtserver.com/abaxinteractive/track.php?" . http_build_query($params, '', '&');
			try{
				$sql = "insert into s2scam set sendurl=?, created=?";
				if($this->_connection->execute($sql,array($url, time()))){
					return $this->_connection->getLastInsert();
				}
			}catch (Exception $e){
				QLog::log(__CLASS__.' '.__METHOD__.' --- '.$e->getMessage(), QLog::ERR);
				throw new Model_Exception($e->getMessage(), $e->getCode());
			}
		}
		
}